#include "menu.h"

#define Res1 0x4103
#define Res2 0x4105
#define TIME 3



int main(void)
{
	
	int op;
	timer_init(0, LCOM_MODE);
	timer_init(2, LCOM_MODE);
	timer_load(0, get_divider(1000.0));
	
	_go32_dpmi_seginfo old_timer_irq;
	install_asm_irq_handler(T0_IRQ, asm_wait, &old_timer_irq);
	
	
	
	do
	{
		
		printf("Video Mode:\n");
		printf("1. 800x600\n");
		printf("2. 1024x768\n");
		printf("0. Exit\n");
		printf("Option:");
		scanf ("%d",&op);

		switch ( op )
		{
			case 1:
				HRES = 800;
				VRES = 600;
				base = enter_graphics(Res1,&map);
				start_menu_game();
				leave_graphics(map);
				break;
			case 2:
				HRES = 1024;
				VRES = 768;
				base = enter_graphics(Res2,&map);
				start_menu_game();
				leave_graphics(map);
				break;
			default:
				printf("Invalid Option.\n");
				break;
		}
	}while(op != 0);
	printf("Exiting Program.\n");
	//reinstall_asm_irq_handler(KBD_IRQ, &old_kbd_irq);
	reinstall_asm_irq_handler(T0_IRQ, &old_timer_irq);
	return 0;
}
